<template>
	<view>

		<template v-for="(item,index) in  tabBarList['admin']" :key="index">
				<page-template v-if="index==selected" :templateId="item.templateId"></page-template>
		</template>


		<u-tabbar :value="selected" @change="value=>selected=value" fixed activeColor="#d81e06" safeAreaInsetBottom>
			<u-tabbar-item v-for="(item,index) in  tabBarList['admin']" :key="index" :text="item.text"
				:icon="item.iconPath"></u-tabbar-item>
		</u-tabbar>
	</view>

</template>

<script setup>
	import {
		ref
	} from 'vue'

	import PageTemplate from '@/pages/template/PageTemplate/PageTemplate.vue'
	const selected = ref(0);

	
	
	const tabBarList = {
		'user': [{
			iconPath: "home",
			text: '主页',
			pagePath: '/pages/home/home',
			componentName: 'Home',
			templateId: '0'
		}],
		'admin': [{
			iconPath: "home",
			text: '主页',
			pagePath: '/pages/home/home',
			componentName: 'Home',
			templateId: '0'
		}, {
			iconPath: "share",
			text: '管理',
			pagePath: '/pages/manage/manage',
			componentName: 'Manage',
			templateId: '1'
		}, {
			iconPath: "star",
			text: '首页',
			pagePath: '/pages/index/index',
			componentName: 'Index',
			templateId: '2'
		}]
	}
	
</script>